package org.example.controller;

import org.example.client.ProvideClient;
import org.example.domain.CommonTest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class ComsumerController {
    @Autowired
    private ProvideClient provideClient;

    @GetMapping("/offer")
    public String offerService(){
        System.out.println("comsumer service invoke");
        //执行在注册中心注册的远程服务调用
        String offerResult = provideClient.offerService();
        return "comsumer service invoke"+"======"+offerResult;
    }

    @GetMapping("/offerTest")
    public CommonTest offerTestService(){
        return provideClient.offerTestService();
    }
}
